package com.woniuxy.kaer.shop.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.kaer.commons.util.PageInfo;
import com.woniuxy.kaer.dto.CollectProductDTO;
import com.woniuxy.kaer.dto.ShoppingCarDTO;
import com.woniuxy.kaer.form.PageForm;
import com.woniuxy.kaer.form.SearchProductForm;
import com.woniuxy.kaer.param.AddProductParam;
import com.woniuxy.kaer.param.AddShoppingParam;
import com.woniuxy.kaer.param.PageParam;
import com.woniuxy.kaer.param.SearchProductParam;
import com.woniuxy.kaer.shop.model.Product;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 郭建东
 * @since 2025年02月17日
 */
public interface ProductService extends IService<Product> {

    void addProduct(AddProductParam param)throws Exception;

    void updateProductState(Integer productId)throws Exception;

    void updateProductPrice(Integer productId, BigDecimal price)throws Exception;

    void updateProductInventory(Integer productId, Long inventory)throws Exception;

    PageInfo searchProductByKeyword(SearchProductParam param)throws Exception;

    void productCollect(Integer productId, Integer userId)throws Exception;

    void cancelCollect(Integer productId, Integer userId)throws Exception;

    void addShoppingCar(AddShoppingParam param, Integer userId)throws Exception;

    PageInfo searchCollect(Integer userId, PageForm form)throws Exception;

    List<CollectProductDTO> selectCollectRank()throws Exception;

    PageInfo searchMyShoppingCar(PageParam bean, Integer userId)throws Exception;

    String upImage(MultipartFile file)throws Exception;
}
